package com.ffdms.mobileoffice;

import java.util.ArrayList;
import java.util.List;

import android.os.Bundle;
import android.view.View;
import android.widget.AdapterView;
import android.widget.GridView;
import android.widget.AdapterView.OnItemClickListener;

public class MoreActivity extends BaseActivity {
	private GridView mGridView;

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_more);
		init();
	}

	private void init() {
		mGridView = (GridView) findViewById(R.id.gridview);
		installDashboard();
	}

	private void installDashboard() {
		final List<ModuleDashboardInfo> Plans = new ArrayList<ModuleDashboardInfo>();
		ModuleDashboardInfo p = new ModuleDashboardInfo();
		p.setImg(R.drawable.more_customer);
		p.setTitle("客户");
		Plans.add(p);

		p = new ModuleDashboardInfo();
		p.setImg(R.drawable.more_checking_in);
		p.setTitle("考勤");
		Plans.add(p);

		p = new ModuleDashboardInfo();
		p.setImg(R.drawable.more_notice);
		p.setTitle("公告");
		Plans.add(p);

		p = new ModuleDashboardInfo();
		p.setImg(R.drawable.more_task);
		p.setTitle("任务");
		Plans.add(p);

		p = new ModuleDashboardInfo();
		p.setImg(R.drawable.more_plan);
		p.setTitle("计划");
		Plans.add(p);

		p = new ModuleDashboardInfo();
		p.setImg(R.drawable.more_project);
		p.setTitle("项目");
		Plans.add(p);

		p = new ModuleDashboardInfo();
		p.setImg(R.drawable.more_knowledge);
		p.setTitle("知识");
		Plans.add(p);

		p = new ModuleDashboardInfo();
		p.setImg(R.drawable.more_address_book);
		p.setTitle("通信录");
		Plans.add(p);

		p = new ModuleDashboardInfo();
		p.setImg(R.drawable.more_system_remind);
		p.setTitle("系统提醒");
		Plans.add(p);

		p = new ModuleDashboardInfo();
		p.setImg(R.drawable.more_forum);
		p.setTitle("论坛");
		Plans.add(p);
		ModuleDashboardListAdapter adp = new ModuleDashboardListAdapter(this,
				Plans);
		mGridView.setAdapter(adp);
		mGridView.setOnItemClickListener(new OnItemClickListener() {

			@Override
			public void onItemClick(AdapterView<?> arg0, View arg1, int arg2,
					long arg3) {
				// ModuleDashboardInfo n = Plans.get(arg2);
				// Intent t = n.getIntent();
				// startActivity(t);
			}
		});
	}
}
